<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        html,
        body {
            padding: 0px;
            margin: 0px;
        }

        .formpane {
            top: 10px;
            right: 10px;
            /* background: rgba(230, 230, 230, 0.85); */
        }

        .railLine {
            top: 10px;
            left: 10px;
            width: 170px;
            height: 200px;
        }
    </style>
    <script src="script/ht.js"></script>
</head>
<body>
<script>
    window.onload = init()

    function init (){
        var dm = new ht.DataModel();// 数据容器
        var g3d = new ht.graph3d.Graph3dView(dm);// 三维组件
        g3d.addToDOM();

        addToDOM = function(){
            var self = this,
                view = self.getView(),//获取组件的底层 div
                style = view.style;
            document.body.appendChild(view);//将组件底层div添加进body中
            style.left = '0';//ht 默认将所有的组件的position都设置为absolute绝对定位
            style.right = '0';
            style.top = '0';
            style.bottom = '0';
            window.addEventListener('resize', function () { self.iv(); }, false);//窗口大小改变事件，调用刷新函数
        }
    }
</script>
</body>
</html>